package Presentacion.contabilidad;

import clases.contabilidad.Diario;
import javax.swing.table.DefaultTableModel;

public final class frmLibroDiario extends javax.swing.JInternalFrame {

    public static Diario objDiario;
    private static int pagina;
    private static String sql;
    public static dlgAsiento asiento;

    /**
     * Creates new form frmConsultaCuenta
     */
    public frmLibroDiario() {
        initComponents();
        setResizable(false);
        pagina = 1;
        objDiario = new Diario();
        sql = objDiario.SqlGeneral();
        generartabla();
        inicializar();
        inicializarfechas();
    }

    public void llenardialogo(int fila) {
        objDiario.llenardatosAsiento(Integer.parseInt(tbldiario.getValueAt(fila, 0).toString()));
        asiento.llenardatosAsientoDiario();
        asiento.visiblidad(false);
        mostrarAsientoDiario();
    }

    public void mostrarAsientoDiario() {
        asiento = new dlgAsiento(null, true);
        asiento.setVisible(true);
        asiento.visiblidad(true);

    }

    public static void generartabla() {
        objDiario.llenarTabla(new DefaultTableModel(), 
                tbldiario, sql, lbltotalpaginas, lblpagina, pagina);
    }

    private void inicializar() {
        txtcodigocuenta.setText("");
        txtcodigocuenta.setVisible(false);
        txtcuenta.setText("");
        txtcuenta.setVisible(false);
        txtnasiento.setText("");
        txtnasiento.setVisible(false);

    }

    private void inicializarfechas() {

        dtentre2.setVisible(false);
        dtentre1.setVisible(false);

        dtentre2.setDate(global.Util.StringaDate(global.Util.getFechaActual()));
        dtentre1.setDate(global.Util.StringaDate(global.Util.getFechaActual()));

    }

    private void iffecha() {
        if (cbocriterio.getSelectedItem() == "TODO" && cbofecha.getSelectedItem() == "ENTRE FECHAS") {
            pagina = 1;
            sql = objDiario.Sqlentrefecha(global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));
            generartabla();

        } else if ((cbocriterio.getSelectedItem() == "NUMERO ASIENTO") && cbofecha.getSelectedItem() != "TODO") {
            pagina = 1;

            sql = objDiario.Sqfechaasiento(Integer.parseInt(txtnasiento.getText()), global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));

            generartabla();
        } else if ((cbocriterio.getSelectedItem() == "CODIGO CUENTA") && cbofecha.getSelectedItem() != "TODO") {
            pagina = 1;

            sql = objDiario.Sqfechacodigo(Integer.parseInt(txtcodigocuenta.getText()), global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));

            generartabla();

        } else if ((cbocriterio.getSelectedItem() == "CUENTA") && cbofecha.getSelectedItem() != "TODO") {
            pagina = 1;

            sql = objDiario.Sqfechacuenta(txtcuenta.getText(), global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));

            generartabla();
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbldiario = new javax.swing.JTable();
        jToolBar1 = new javax.swing.JToolBar();
        btnprimero = new javax.swing.JButton();
        btnatras = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        jLabel4 = new javax.swing.JLabel();
        lblpagina = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lbltotalpaginas = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        btnsiguiente = new javax.swing.JButton();
        btnultimo = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        cbofecha = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        cbocriterio = new javax.swing.JComboBox();
        txtnasiento = new javax.swing.JTextField();
        txtcuenta = new javax.swing.JTextField();
        txtcodigocuenta = new javax.swing.JTextField();
        dtentre2 = new com.toedter.calendar.JDateChooser();
        dtentre1 = new com.toedter.calendar.JDateChooser();

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        tbldiario.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbldiario.setToolTipText("");
        tbldiario.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbldiarioMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tbldiario);

        jToolBar1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        btnprimero.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/primer.png"))); // NOI18N
        btnprimero.setFocusable(false);
        btnprimero.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnprimero.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnprimero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnprimeroActionPerformed(evt);
            }
        });
        jToolBar1.add(btnprimero);

        btnatras.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/atras.png"))); // NOI18N
        btnatras.setToolTipText("");
        btnatras.setFocusable(false);
        btnatras.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnatras.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnatras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnatrasActionPerformed(evt);
            }
        });
        jToolBar1.add(btnatras);
        jToolBar1.add(jSeparator1);

        jLabel4.setText("Pagina ");
        jToolBar1.add(jLabel4);

        lblpagina.setText("jLabel1");
        jToolBar1.add(lblpagina);

        jLabel5.setText(" de ");
        jToolBar1.add(jLabel5);

        lbltotalpaginas.setText("jLabel1");
        jToolBar1.add(lbltotalpaginas);
        jToolBar1.add(jSeparator2);

        btnsiguiente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/siguiente.png"))); // NOI18N
        btnsiguiente.setFocusable(false);
        btnsiguiente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnsiguiente.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnsiguiente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnsiguienteActionPerformed(evt);
            }
        });
        jToolBar1.add(btnsiguiente);

        btnultimo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/ultimos.png"))); // NOI18N
        btnultimo.setFocusable(false);
        btnultimo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnultimo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnultimo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnultimoActionPerformed(evt);
            }
        });
        jToolBar1.add(btnultimo);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 902, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "BUSQUEDA POR:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setText("FECHA");
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 30, -1, -1));

        cbofecha.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TODO", "ENTRE FECHAS" }));
        cbofecha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbofechaActionPerformed(evt);
            }
        });
        jPanel1.add(cbofecha, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 50, 140, -1));

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel3.setText("CRITERIO");
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 30, -1, -1));

        cbocriterio.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TODO", "NUMERO ASIENTO", "CODIGO CUENTA", "CUENTA" }));
        cbocriterio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbocriterioActionPerformed(evt);
            }
        });
        jPanel1.add(cbocriterio, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 50, 140, -1));

        txtnasiento.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtnasientoKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtnasientoKeyTyped(evt);
            }
        });
        jPanel1.add(txtnasiento, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 50, 100, -1));

        txtcuenta.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtcuentaKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtcuentaKeyTyped(evt);
            }
        });
        jPanel1.add(txtcuenta, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 50, 220, -1));

        txtcodigocuenta.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtcodigocuentaKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtcodigocuentaKeyTyped(evt);
            }
        });
        jPanel1.add(txtcodigocuenta, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 50, 140, -1));

        dtentre2.setDateFormatString("yyyy/MM/dd");
        dtentre2.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                dtentre2PropertyChange(evt);
            }
        });
        jPanel1.add(dtentre2, new org.netbeans.lib.awtextra.AbsoluteConstraints(730, 50, 120, -1));

        dtentre1.setDateFormatString("yyyy/MM/dd");
        dtentre1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                dtentre1PropertyChange(evt);
            }
        });
        jPanel1.add(dtentre1, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 50, 120, -1));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnprimeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnprimeroActionPerformed
        pagina = 1;
        generartabla();
    }//GEN-LAST:event_btnprimeroActionPerformed

    private void btnatrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnatrasActionPerformed
        if (pagina > 1) {
            pagina--;
            generartabla();
        }
    }//GEN-LAST:event_btnatrasActionPerformed

    private void btnsiguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsiguienteActionPerformed
        if (objDiario.p.getTotalpaginas() > pagina) {
            pagina++;
            generartabla();
        }
    }//GEN-LAST:event_btnsiguienteActionPerformed

    private void btnultimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnultimoActionPerformed
        pagina = objDiario.p.getTotalpaginas();
        generartabla();
    }//GEN-LAST:event_btnultimoActionPerformed

    private void tbldiarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbldiarioMouseClicked
        int click = evt.getClickCount();
        if (click == 2) {
            llenardialogo(tbldiario.getSelectedRow());
        }
    }//GEN-LAST:event_tbldiarioMouseClicked

    private void cbofechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbofechaActionPerformed
        inicializarfechas();
        if (cbofecha.getSelectedItem() == "ENTRE FECHAS") {
            dtentre2.setVisible(true);
            dtentre1.setVisible(true);

        }

        if (cbocriterio.getSelectedItem() == "TODO" && cbofecha.getSelectedItem() == "TODO") {
            pagina = 1;
            sql = objDiario.SqlGeneral();
            generartabla();

        } else {
            iffecha();
        }

    }//GEN-LAST:event_cbofechaActionPerformed

    private void cbocriterioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbocriterioActionPerformed
        inicializar();
        if (cbocriterio.getSelectedItem() == "TODO" && cbofecha.getSelectedItem() == "TODO") {
            pagina = 1;
            sql = objDiario.SqlGeneral();
            generartabla();

        } else if (cbocriterio.getSelectedItem() == "TODO" && cbofecha.getSelectedItem() == "ENTRE FECHAS") {
            pagina = 1;
            sql = objDiario.Sqlentrefecha(global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));
            generartabla();
            dtentre1.requestFocus();

        } else if (cbocriterio.getSelectedItem() == "NUMERO ASIENTO") {
            txtnasiento.setVisible(true);
            txtnasiento.requestFocus();

        } else if (cbocriterio.getSelectedItem() == "CUENTA") {
            txtcuenta.setVisible(true);
            txtcuenta.requestFocus();

        } else if (cbocriterio.getSelectedItem() == "CODIGO CUENTA") {
            txtcodigocuenta.setVisible(true);
            txtcodigocuenta.requestFocus();
        }
    }//GEN-LAST:event_cbocriterioActionPerformed

    private void txtnasientoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtnasientoKeyReleased
        if ((global.Validaciones.comprobarNulo(txtnasiento)) && (cbofecha.getSelectedItem() == "TODO")) {
            pagina = 1;
            sql = objDiario.Sqlnasiento(Integer.parseInt(txtnasiento.getText()));
            generartabla();

        } else if ((cbocriterio.getSelectedItem() == "NUMERO ASIENTO") && cbofecha.getSelectedItem() != "TODO") {
            pagina = 1;
            sql = objDiario.Sqfechaasiento(Integer.parseInt(txtnasiento.getText()), global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));
            generartabla();
        }
    }//GEN-LAST:event_txtnasientoKeyReleased

    private void txtnasientoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtnasientoKeyTyped
        global.Validaciones.soloNumeros(evt, txtnasiento,15);
    }//GEN-LAST:event_txtnasientoKeyTyped

    private void txtcuentaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtcuentaKeyReleased
        global.Validaciones.convertirMayuscula(txtcuenta);
        if ((global.Validaciones.comprobarNulo(txtcuenta)) && (cbofecha.getSelectedItem() == "TODO")) {
            pagina = 1;
            sql = objDiario.Sqlcuenta(txtcuenta.getText());
            generartabla();
        } else if ((cbocriterio.getSelectedItem() == "CUENTA") && cbofecha.getSelectedItem() != "TODO") {
            pagina = 1;

            sql = objDiario.Sqfechacuenta(txtcuenta.getText(), global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));

            generartabla();
        }
    }//GEN-LAST:event_txtcuentaKeyReleased

    private void txtcuentaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtcuentaKeyTyped
        global.Validaciones.soloLetras(evt, txtcuenta);
    }//GEN-LAST:event_txtcuentaKeyTyped

    private void txtcodigocuentaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtcodigocuentaKeyReleased
        if ((global.Validaciones.comprobarNulo(txtcodigocuenta)) && (cbofecha.getSelectedItem() == "TODO")) {
            pagina = 1;
            sql = objDiario.Sqlcodigo(txtcodigocuenta.getText());
            generartabla();
        } else if ((cbocriterio.getSelectedItem() == "CODIGO CUENTA") && cbofecha.getSelectedItem() != "TODO") {
            pagina = 1;

            sql = objDiario.Sqfechacodigo(Integer.parseInt(txtcodigocuenta.getText()), global.Util.DateaString(dtentre1.getDate()), global.Util.DateaString(dtentre2.getDate()));

            generartabla();
        }
       
    }//GEN-LAST:event_txtcodigocuentaKeyReleased

    private void txtcodigocuentaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtcodigocuentaKeyTyped
        global.Validaciones.soloNumeros(evt, txtcodigocuenta, 15);
    }//GEN-LAST:event_txtcodigocuentaKeyTyped

    private void dtentre2PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_dtentre2PropertyChange

        iffecha();
    }//GEN-LAST:event_dtentre2PropertyChange

    private void dtentre1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_dtentre1PropertyChange
        iffecha();
    }//GEN-LAST:event_dtentre1PropertyChange

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(frmLibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(frmLibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(frmLibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(frmLibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new frmLibroDiario().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnatras;
    private javax.swing.JButton btnprimero;
    private javax.swing.JButton btnsiguiente;
    private javax.swing.JButton btnultimo;
    private javax.swing.JComboBox cbocriterio;
    private javax.swing.JComboBox cbofecha;
    private com.toedter.calendar.JDateChooser dtentre1;
    private com.toedter.calendar.JDateChooser dtentre2;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JToolBar jToolBar1;
    private static javax.swing.JLabel lblpagina;
    private static javax.swing.JLabel lbltotalpaginas;
    public static javax.swing.JTable tbldiario;
    private javax.swing.JTextField txtcodigocuenta;
    private javax.swing.JTextField txtcuenta;
    private javax.swing.JTextField txtnasiento;
    // End of variables declaration//GEN-END:variables
}
